﻿using Unity.Entities;
using UnityEngine;

public class EntityReferencesAuthoring : MonoBehaviour
{
    public GameObject EnemyEntity;
    public class Baker : Baker<EntityReferencesAuthoring>
    {
        public override void Bake(EntityReferencesAuthoring authoring)
        {
            var entity = GetEntity(TransformUsageFlags.None);
            AddComponent(entity, new EntityReferences
            {
                EnemyPrefabEntity = GetEntity(authoring.EnemyEntity, TransformUsageFlags.Dynamic),
            });
        }
    }

}

public struct EntityReferences : IComponentData
{
    public Entity EnemyPrefabEntity;
}